export type Config = {
  server?: string;
  baseURL?: string;
  data?: object;
  headers?: object;
  token?: string;
};

type Callback = {
  (name: string): void;
};

export type HttpRequestParams = {
  url: string;
  payload?: any;
  config: Config;
  callback?: Callback;
};

type Method =
  | "get"
  | "GET"
  | "post"
  | "POST"
  | "delete"
  | "DELETE"
  | "head"
  | "HEAD"
  | "options"
  | "OPTIONS"
  | "put"
  | "PUT"
  | "patch"
  | "PATCH"
  | "download"
  | "DOWNLOAD"
  | "upload"
  | "UPLOAD";

export type EndpointOptions = {
  [key: string]: {
    method: Method;
    endpoint: string;
  };
};
